{{extend "layout.html"}}

{{block menu}}
{{menu('config')}}
{{end}}

{{block content_sidebar}}
{{use "jquery"}}
{{use "jsmenu"}}
{{
menu_items = [
    {
    'name': 'my_config',
    'title':'个人设置',
    'subs':[
            {'name': 'information', 'title':'个人信息', 'link':'/config/user/information'},
            {'name': 'password', 'title':'修改口令', 'link':'/config/user/change_password'},
            ]
    },
]
menu_items.append(
{
'name': 'messages',
'title':'消息',
'link':'/config/messages/list',
}
)

if request.user and request.user.is_superuser:
    menu_items.append(
    {
    'name': 'admin_config',
    'title':'管理员设置',
    'subs':[
        {'name':'users', 'title':'用户管理', 'link':'/config/users/list'},
        {'name':'kfzx', 'title':'开发中心管理', 'link':'/config/kfzx/list'},
        {'name':'tx', 'title':'条线管理', 'link':'/config/tx/list'},
        {'name':'department', 'title':'部门管理', 'link':'/config/department/list'},
        {'name':'roles', 'title':'角色管理', 'link':'/config/roles/list'},
        {'name':'permissions', 'title':'权限管理', 'link':'/config/permissions/list'},
        {'name':'links', 'title':'首页链接管理', 'link':'/portal/links/admin'},
            ]
    }
    )
elif request.user and request.user.is_manager:
    menu_items.append(
    {
    'name': 'admin_config',
    'title':'管理员设置',
    'subs':[
        {'name':'users', 'title':'用户管理', 'link':'/config/users/list'},
            ]
    }
    )
pass
menu_items.append(
{
'name': 'resource_admin',
'title':'资源参数设置',
'subs':[
    {'name':'team', 'title':'团队设置', 'link':'/resource/teams/list'},
    {'name':'duties', 'title':'职务设置', 'link':'/resource/duties/list'},
    {'name':'position', 'title':'岗位设置', 'link':'/resource/position/list'},
        ]
}
)
if request.user and request.user.is_superuser:
    menu_items.append(
        {'name': 'log', 'title':'日志查询', 'link':'/config/log/list'}
    )
pass
}}  
<div class="sidebar">
    {{block sub_menu}}
    {{sub_menu(menu_items, 'my_config', 'information')}}
    {{end}}
</div>
{{end}}
